"""
工资结算
"""
from abc import ABCMeta, abstractmethod


class Staff(metaclass=ABCMeta):
    """员工类"""


    def __init__(self, name):
        self.name = name

    @abstractmethod
    def get_salary(self):
        """获得月薪的方法"""


class Manager(Staff):
    """部门经理"""

    def get_salary(self):
        return 12000


class Programmer(Staff):
    """程序员"""

    def __init__(self, name):
        super().__init__(name)
        self.working_hour = 0


    def get_salary(self):
        return 200 * self.working_hour


class Sasman(Staff):
    """销售员"""

    def __init__(self, name):
        super().__init__(name)
        self.sales = 0


    def get_salary(self):
        return 1800 + self.sales * 00.5


def main():
    """主函数"""
    emps = [
        Manager('曹操'), Programmer('荀彧'), Sasman('马超')
    ]
    for emp in emps:
        if isinstance(emp, Programmer):
            emp.working_hour = int(input(f'请输入{emp.name}工作时间'))
        elif isinstance(emp, Sasman):
            emp.sales = float(input(f'请输入{emp.name}销售额'))
        print(f'{emp.name}本月工资为:{emp.get_salary()}元')


if __name__ == '__main__':
    main()
